let qm = obj => {
  let arr = []
  let s = ''
  let objL = Object.keys(obj).length
  if (objL !== 0) {
    for (let Key in obj) {
      if (obj[Key].operator.length !== 0 && obj[Key].value.length !== 0) {
        let f
        var regPos = /^\d+(\.\d+)?$/ // 非负浮点数
        var regNeg = /^(-(([0-9]+\.[0-9]*[1-9][0-9]*)|([0-9]*[1-9][0-9]*\.[0-9]+)|([0-9]*[1-9][0-9]*)))$/ // 负浮点数
        if (regPos.test(obj[Key].value) || regNeg.test(obj[Key].value)) {
          f = ''
        } else {
          f = "'"
        }
        if (Key === 'user_name' || Key === 'name' || Key === 'ref_user_name') {
          arr.push(`${Key} like '%${obj[Key].value}%'`)
          // if(Key == 'user_name') arr.push(`${obj[Key]} like '%${obj[Key].value}%'`)
          // if(Key == 'name') arr.push(`name like '%${obj[Key].value}%'`)
        } else {
          arr.push(Key + obj[Key].operator + f + obj[Key].value + f)
        }
      }
    }

    if (arr.length !== 0) {
      for (let i = 0; i < arr.length; i++) {
        s += arr[i] + `${i === arr.length - 1 ? '' : ','}`
      }
    } else {
      return
    }
  } else {
    return
  }
  return s
}
export default qm
